]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
status/volume: Small cleanup
authorFlorian Müllner <fmuellner@gnome.org>
Fri, 15 Jul 2022 16:15:13 +0000 (18:15 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Tue, 19 Jul 2022 12:56:46 +0000 (14:56 +0200)
There is no point in splitting out a function that has one caller
and sets a single property.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2380>

js/ui/status/volume.js

index bbbfb454bee6890c62b186217ad1289d8d9375cf..21aef0a6f7625079477ecabc8ace859f1806ff40 100644 (file)
@@ -254,19 +254,16 @@ var OutputStreamSlider = class extends StreamSlider {
         return false;
     }
 
-    _updateSliderIcon() {
+    _portChanged() {
+        const hasHeadphones = this._findHeadphones(this._stream);
+        if (hasHeadphones === this._hasHeadphones)
+            return;
+
+        this._hasHeadphones = hasHeadphones;
         this._icon.icon_name = this._hasHeadphones
             ? 'audio-headphones-symbolic'
             : 'audio-speakers-symbolic';
     }
-
-    _portChanged() {
-        let hasHeadphones = this._findHeadphones(this._stream);
-        if (hasHeadphones != this._hasHeadphones) {
-            this._hasHeadphones = hasHeadphones;
-            this._updateSliderIcon();
-        }
-    }
 };
 
 var InputStreamSlider = class extends StreamSlider {